local chidan_active = fk.CreateSkill {
  name = "#inker_chidan_active",
}

chidan_active:addEffect("active", {
  interaction = function(self)
    if #self.vs_names > 0 then
      return UI.CardNameBox { choices = self.vs_names, skill_name = self.skillName }
    end
  end,
  card_num = 1,
  card_filter = function(self, player, to_select, selected)
    if not self.interaction then return end
    return #selected == 0 and Fk:getCardById(to_select).trueName == "slash"
  end,
  target_num = 1,
  target_filter = function(self, player, to_select, selected, selected_cards)
    if not selected_cards[1] or not self.interaction then return false end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(selected_cards)
    card.skillName = "inker_chidan"
    return #selected == 0 and table.contains(self.targets, to_select) and #card:getAvailableTargets(player, { bypass_times = true }) > 0
  end,
})

return chidan_active